package com.yhy.server.controller;

import com.yhy.server.interceptor.UserHolder;
import com.yhy.server.service.HuanXinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/huanxin")
public class HuanXinController {

    /**
     * 环信用户信息
     *
     * 接口路径：GET/huanxin/user
     *
     * 返回值:
     *      username: 用户名(String)
     *      password: 用户密码(String)
     */
    @GetMapping("/user")
    public ResponseEntity huanxinUser(){
        Map<String, String> map = new HashMap<>();
        map.put("username", UserHolder.getUserId().toString());
        map.put("password","123456");
        return ResponseEntity.ok(map);
    }
}
